import { FC } from 'react';
import classNames from 'classnames';
import { Button as AntdButton } from 'antd';
import type { ButtonProps as AntdButtonProps } from 'antd/lib/button';
import { observer } from 'mobx-react';

export type ButtonProps = AntdButtonProps;

const Button: FC<ButtonProps> = ({ children, className, ...rest }) => {
  return (
    <AntdButton className={classNames(className)} {...rest}>
      {children}
    </AntdButton>
  );
};

// 设置默认属性
Button.defaultProps = {
  ...AntdButton.defaultProps,
  size: 'small', // 小
  shape: 'round' // 圆角
};

export default observer(Button);
